package com.sky.mapper;

import com.sky.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author rookie001
 * @creat 2023-04-24-9:40
 */
@Mapper
public interface DishFlavorMapper {
    //批量插入口味
    void insertBatch(@Param("flavors") List<DishFlavor> flavors, @Param("dishId") Long dishId);

    //根据id删除口味数据
    @Delete("delete from  dish_flavor where dish_id =#{id}")
    void deleteByDishId(Long id);
    //根据id查找对应口味
    @Select("select *from dish_flavor where dish_id =#{id}")
    List<DishFlavor> getByDishId(Long id);
}
